package com.nci.cloud.unit.management.FilePivotClientByProtoBuf;

import com.nci.cloud.unit.management.ProtoBufFileTrans.FileUploadUtils;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;



public class ProtoBufClientHandler extends ChannelInboundHandlerAdapter {
    @Override
    public void channelActive(ChannelHandlerContext ctx) {
        // file upload
        FileUploadUtils.fileUpload("demo","passwd","D:\\软件\\ideaIU-2017.3.3.exe",ctx);
    }

    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {

    }



    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
        cause.printStackTrace();
        ctx.close();
    }



}
